A user program for controlling a controlled system is contained in a programmable controller. The user program is generally described by a ladder language, an SFC (a sequential function chart), and so forth.
The user program is constituted by a plurality of modules in many cases. The modules are respectively allocated parts of the control of the controlled system. Division of the user program into the plurality of modules is particularly effective in a case where the control of the controlled system is complicated. It is also effective in order to facilitate the creation of the user program or share the creation of the user program among a plurality of persons even if a control system is not necessarily complicated. The control system is divided depending on control equipments constituting the controlled system, the types of driving devices, the control functions and so forth, and the control of each of parts formed by the division is allocated to each of the modules.
FIG. 7 illustrates one example of a control system using a programmable controller. There is a conveyer for carrying an article from a point x1 to a point x2. A motor M2 is provided for driving the conveyer in the forward direction (rightward in FIG. 7). A conveyer for carrying the article from the point x2 to a point x3 is driven in the forward direction by a motor M3. It is necessary to return the article from the point x3 (or x2) to the point x2 (or x1) in an emergency, or in order to cope with the other situation. A motor M1 is provided in order to drive the above-mentioned two conveyers in the reverse direction (leftward in FIG. 7). A plurality of user program modules share the control of the control system depending on the share of driving devices (control equipments), the control ranges, the driving directions and so forth.
Consider a case where the control range is divided into right and left control ranges with the point x2 used as the boundary, and user program modules sharing each of the control ranges are created. In the left range, a switch SW2 for moving the conveyer in the forward direction and a switch SW1 for moving the conveyer in the reverse direction are provided in a control panel 51. In the right range, a switch SW4 for moving the conveyer in the forward direction and a switch SW3 for moving the conveyer in the reverse direction are provided in a control panel 52. Switch inputs from the switches SW1 to SW4 are fed to an I/O unit 41 connected to a programmable controller 40. The motors M1 to M3 are driven by output signals from the I/O unit 41. A user program for controlling the motors M1 to M3 in response to the inputs from the switches SW1 to SW4 is stored in a user program memory in the programmable controller 40.
A user program module A for controlling the left half range and a user program module B for controlling the right half range are illustrated by a ladder diagram in FIG. 8.
In the ladder diagram, reference signs m1, m2 and m3 denote relays for respectively representing outputs for driving the motors M1, M2 and M3. Reference signs s1, s2, s3 and s4 denote input contacts (normally open contacts) respectively representing signals fed from the switches SW1, SW2, SW3 and SW4. Reference signs c1, c2 and c3 denote internal contacts (normally closed contacts) respectively opened or closed by the relays m1, m2 and m3.
In the module A, when the switch SW2 is turned on, the input contact s2 is closed, whereby the relay m2 operates so that the motor M2 is driven, provided that the internal contact c1 is on (provided that the motor M1 is not driven) (an address 00093). When the switch SW1 is turned on, the input contact s1 is closed, whereby the relay m1 operates so that the motor M1 is driven, provided that the internal contacts c2 and c3 are on (provided that both the motors M2 and M3 are not driven) (an address 00088).
In the module B, when the switch SW4 is turned on, the input contact s4 is closed, whereby the relay m3 operates so that the motor M3 is driven, provided that the internal contact c is on (provided that the motor M1 is not driven) (an address 00157). When the switch SW3 is turned on, the input contact s3 is closed, whereby the relay m1 operates so that the motor M1 is driven, provided that the internal contacts c2 and c3 are on (provided that both the motors M2 and M3 are not driven) (an address 00152).
To prevent an equipment or a device from starting its operations or prevent the operations from being continued unless conditions set in advance are satisfied is referred to as interlock. In the above-mentioned examples of the modules A and B, the internal contacts c1, c2 and c3 realize the interlock. A program for realizing the interlock (including its part) is referred to as an interlock program.
In the module A, inputs are si and s2, and outputs are m1 and m2. The internal contacts c1 and c2 are respectively related to the outputs m1 and m2. However, the internal contact c3 is related to the output m3 of the module B. Similarly, in the module B, the internal contact c2 is related to the output m2 of the module A.
As described in the foregoing, in a case where the control of the controlled system is divided into a plurality of parts from the points of view of the control equipment or device or the driving device constituting the controlled system, the control range, the control function and so forth, and the parts of the control are respectively allocated to the user program modules, the interlock program in each of the user program modules include an element related to the module and an element related to the other module in many cases. When one of the user program modules is created, the description of the element related to the other user program module particularly involves difficulties in many cases. The reason for this is that when the one module is created, the input and output states, the order in which programs are executed and so forth in the other module must be sufficiently grasped. When a plurality of persons share the creation of the modules, it involves further difficulties.